<?php

namespace app\api\model;

use think\Model;

class ForumEssayModel extends Model
{
    //隐藏type_id
    protected $hidden = ['type_id'];
     protected $name = 'forum_essay';
     //维护时间戳
    protected $autoWriteTimestamp = true;
    protected $createTime = 'createtime';
    //只要时分秒
    protected $dateFormat = 'Y-m-d';
    //关联分类
    public function typeId()
    {
        return $this->belongsTo('ForumTypeModel', 'type_id', 'id');
    }
}